﻿using System;
using CTEM.Controllers.Global;

/// <summary>
/// Entity for table Construction
/// </summary>

namespace CTEM.Models
{
    public class WH_StorageDTO
    {
        public long StorageID { get; set; }
        public long WarehouseID { get; set; }
        public long DebtID { get; set; }
        public DateTime DateStorage { get; set; }
        public string Officer { get; set; }
        public string Contents { get; set; }
        public long MaterialID { get; set; }
        public long GroupMaterialID { get; set; }
        public double Quantity { get; set; }
        public long Price { get; set; }
        public long TotalCost { get; set; }
        public string Note { get; set; }
        public DateTime? CreatedDate { get; set; }
        public DateTime? LastUpdated { get; set; }
        public string CreatedBy { get; set; }
        public string UpdatedBy { get; set; }

        public long ConstructionID { get; set; }
        public string Unit { get; set; }
        public string PriceFormatted { get; set; }
        public string TotalCostFormatted { get; set; }

        public WH_StorageDTO()
        {
            StorageID = 0;
            WarehouseID = 0;
            DebtID = 0;
            DateStorage = DateTime.Today;
            Officer = Constants.EMPTY_TEXT;
            TotalCost = 0;
        }

        public override bool Equals(object obj)
        {
            if (ReferenceEquals(null, obj)) return false;
            if (ReferenceEquals(this, obj)) return true;
            if (obj.GetType() != typeof(WH_StorageDTO)) return false;
            return Equals((WH_StorageDTO)obj);
        }

        public bool Equals(WH_StorageDTO other)
        {
            if (ReferenceEquals(null, other)) return false;
            if (ReferenceEquals(this, other)) return true;
            return Equals(other.StorageID, StorageID);
        }

        public static bool operator ==(WH_StorageDTO left, WH_StorageDTO right)
        {
            return Equals(left, right);
        }

        public static bool operator !=(WH_StorageDTO left, WH_StorageDTO right)
        {
            return !Equals(left, right);
        }

        public override int GetHashCode()
        {
            return base.GetHashCode();
        }
    }  
}